In various daily systems, log recording is a means widely used for information recording and fault location. When log files are recorded, a mode of cyclic covering of multiple log files is commonly used. There are multiple log files, and log recording, particularly a recording sequence of logs, should not be influenced by the restart of a system in general when the system is restarted. Therefore, how to determine a correct log file for continuing recording becomes a problem after the system is restarted.
For the above-mentioned problem, solutions in the relate art are as follows:
1) for a system without any requirement on a recording time length of the log files, a capacity of each log file is generally fixed. And after such a system is restarted, the last log file where a log is recorded before restart can be judged according to the capacities of the log files; but however, the method is inapplicable to a system with a requirement on the recording time length of the log files.
2) for the system with the requirement on the recording time length of the log files, the capacity of each log file is unfixed, so the last log file where the log is recorded before restart cannot be judged according to the capacities of the log files. At the moment, timestamps are generally added into names of the log files, so that the last log file where the log is recorded before restart can be determined for continuing recording according to the timestamps after the system is restarted; but a shortcoming of the method is influenced by system time, and once the system time is changed to be earlier, the last recording file cannot be correctly determined after the system is restarted, which further causes the recording sequence disorder of the log files.
For the problem of log file recording sequence disorder caused by the influence of changing of the system time on a log recording process of the system with the requirement on the recording time length of the log files in the related art, none effective solution is provided.